function fd = MJD2frac(mjd)
%MJD2frac - Modified julian date to fractional year conversion
%
%       FD = MJD2frac(MJD)
%
% Let MJD be a modified julian date vector. This function computes the 
% corresponding vector of fractional year dates, i.e. a date vector whose
% values are expressed in standard decimal part of a year yyyy.ddddd 
% (e.g., 53372, which is the MJD corresponding to 2-Jan-2005, is converted 
% into 2005+1/365 = 2005.00274).
%
% See also date2gpsw, gpsw2serial, frac2MJD, serial2frac, frac2serial, 
% MJD2serial, serial2YMD, YMD2serial, leapy.

% G. Teza, 2021

mjd = mjd(:);       % to have a column vector
mjd = double(mjd);
 
sd = MJD2serial(mjd);
fd = serial2frac(sd);